home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Language/OS - Multiplatform Resource Library
/
LANGUAGE OS.iso
/
dsp
/
dspgroup
/
sound.arc
/
SAMPRATE.C
< prev
next >
Encoding:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
C/C++ Source or Header
|
1988-01-22
|
338 b
|
21 lines
/* Set sampling rate */
#define IOBASE 0x300
#define CLOCK 6250000
#define DIVISOR 284
main(argc,argv)
int argc;
char *argv[];
{
short divisor;
long samprate,atol();
samprate = atol(argv[1]);
divisor = CLOCK/samprate;
outportb(IOBASE+7,0xb4);
outportb(IOBASE+6,divisor);
outportb(IOBASE+6,divisor >> 8);
}